package com.yg.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yg.pojo.TOrderItem;
import com.yg.mapper.TOrderItemMapper;
import com.yg.service.TOrderItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author kotori
 * @since 2022-11-18
 */
@Service
public class TOrderItemServiceImpl extends ServiceImpl<TOrderItemMapper, TOrderItem> implements TOrderItemService {

    @Autowired
    private TOrderItemMapper orderItemMapper;

    @Override
    public List<TOrderItem> getOrderItemsByOrderId(String oderId) {
        LambdaQueryWrapper<TOrderItem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(TOrderItem::getOrderId, oderId);
        return orderItemMapper.selectList(lambdaQueryWrapper);
    }
}
